From 4f36374bde6f40b160665e126c9f1d6ecd808055 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Thu, 20 Nov 2025 00:51:22 +0000 Subject: (임수민) params 에러 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/files/[...path]/route.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'app/api/files/[...path]') diff --git a/app/api/files/[...path]/route.ts b/app/api/files/[...path]/route.ts index 38e76298..90c95458 100644 --- a/app/api/files/[...path]/route.ts +++ b/app/api/files/[...path]/route.ts @@ -66,11 +66,12 @@ const isAllowedPath = (requestedPath: string): boolean => { export async function GET( request: NextRequest, - { params }: { params: { path: string[] } } + { params }: { params: Promise<{ path: string[] }> } ) { try { // 요청된 파일 경로 구성 - const decodedPath = params.path.map(segment => + const resolvedParams = await params; + const decodedPath = resolvedParams.path.map(segment => decodeURIComponent(segment) ); @@ -192,10 +193,11 @@ export async function GET( // HEAD 요청 지원 (파일 정보만 확인) export async function HEAD( request: NextRequest, - { params }: { params: { path: string[] } } + { params }: { params: Promise<{ path: string[] }> } ) { try { - const decodedPath = params.path.map(segment => + const resolvedParams = await params; + const decodedPath = resolvedParams.path.map(segment => decodeURIComponent(segment) ); -- cgit v1.2.3